package com.zretc.service.impl;

import com.zretc.dao.StatisticMapper;
import com.zretc.entity.SalaryDistribute;
import com.zretc.service.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.ws.Action;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author wukai
 * @date 08-21
 * 统计模块的各种数据
 */
@Service
public class StatisticServiceImpl implements StatisticService {
    @Autowired
    private StatisticMapper statisticMapper;
    @Override
    public Map<String, Integer> employeeCountStatistic() {
        Map<String,Integer> map = new HashMap<>();
        Integer mountOfEmployee = statisticMapper.findMountOfEmployee();
        map.put("sumMount",mountOfEmployee);
        Integer employeeMountOnWork = statisticMapper.findEmployeeMountOnWork();
        map.put("onWorkMount",employeeMountOnWork);
        Integer employeeMountNoWork = statisticMapper.findEmployeeMountNoWork();
        map.put("offWorkMount",employeeMountNoWork);
        return map;
    }

    @Override
    public List<SalaryDistribute> salaryDistribute() {
        return statisticMapper.salaryDistribute();
    }

    @Override
    public Map<String, Integer> boyVsGirl() {
        Integer mountOfBoy = statisticMapper.mountOfBoy();
        Integer mountOfGirl = statisticMapper.mountOfGirl();
        Map<String,Integer> map = new HashMap<>();
        map.put("mountOfBoy",mountOfBoy);
        map.put("mountOfGirl",mountOfGirl);
        return map;
    }
}
